//
//  STSuitcaseViewController.swift
//  SeaTransportManage
//
//  Created by guopengwen on 2021/11/27.
//

import UIKit
 
// 提空箱拍照指引
class STSuitcaseViewController: GPBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        setNavBarTitle("箱况照片提供标准")
        addSubviewForPage()
    }

    func addSubviewForPage() {
        addTopBGView()
        
        let img_w = ( kScreenWidth - 45 ) / 2
        let h1 = 144 * img_w / 164.5
        let h2 = 198.66 * img_w / 164.5
        
        let scrollView = UIScrollView.init(frame: CGRect.init(x: 0, y: 0, width: kScreenWidth, height: view.bounds.size.height))
        scrollView.backgroundColor = UIColor.init(hexString: "#FFFFFF", alpha: 0)
        scrollView.contentSize = CGSize.init(width: kScreenWidth, height: 347 + 4 * h1 + h2)
        view.addSubview(scrollView)
        
        let title_1: UILabel = UILabel.init(frame: CGRect.init(x: 16, y: 13, width: kScreenWidth - 32, height: 33))
        title_1.text = "1.箱体四面照"
        title_1.textColor = UIColor.white
        title_1.font = UIFont.systemFont(ofSize: 24, weight: UIFont.Weight.bold)
        scrollView.addSubview(title_1)
        
        var img_arr: Array<UIImageView> = Array();
        var i = 1
        while (i < 10) {
            let img = UIImageView.init(image: UIImage.init(named: "img_suitcase_".appending(String(i))))
            
            scrollView.addSubview(img)
            img_arr.append(img)
            i += 1
        }
        
        img_arr[0].frame = CGRect.init(x: 16, y: 64, width: img_w, height: h1)
        img_arr[1].frame = CGRect.init(x: img_w + 30, y: 64, width: img_w, height: h1)
        img_arr[2].frame = CGRect.init(x: 16, y: 80 + h1, width: img_w, height: h1)
        img_arr[3].frame = CGRect.init(x: 16, y: 80 + h1, width:img_w, height: h1)
        
        let title_2: UILabel = UILabel.init(frame: CGRect.init(x: 13, y: 104 + 2 * h1, width: kScreenWidth - 28, height: 33))
        title_2.text = "2.名牌照（务必清晰）"
        title_2.textColor = UIColor.init(hexString: "#323232", alpha: 1)
        title_2.font = UIFont.systemFont(ofSize: 24, weight: UIFont.Weight.bold)
        scrollView.addSubview(title_2)
        
        img_arr[4].frame = CGRect.init(x: 16, y: 155 + 2 * h1, width:img_w, height: h2)
    
        let title_3: UILabel = UILabel.init(frame: CGRect.init(x: 16, y: 179 + 2 * h1 + h2, width: kScreenWidth - 32, height: 50))
        title_3.text = "3.箱底横梁照（不少于四张）"
        title_3.textColor = UIColor.init(hexString: "#323232", alpha: 1)
        title_3.font = UIFont.systemFont(ofSize: 24, weight: UIFont.Weight.bold)
        scrollView.addSubview(title_3)

        img_arr[5].frame = CGRect.init(x: 16, y: 247 + 2 * h1 + h2, width:img_w, height: h1)
        img_arr[6].frame = CGRect.init(x: 30 + img_w, y: 247 + 2 * h1 + h2, width:img_w, height: h1)
        
        img_arr[7].frame = CGRect.init(x: 16, y: 263 + 3 * h1 + h2, width:img_w, height: h1)
        img_arr[8].frame = CGRect.init(x: 30 + img_w, y: 263 + 3 * h1 + h2, width:img_w, height: h1)
    }

}
